use super::mcp::adaptor::McpManager;
use rig::{
    agent::Agent,
    providers::{anthropic, deepseek, gemini, moonshot, openai, xai},
};
use rig_fastembed::Client;
use std::collections::HashMap;
use std::sync::Arc;
use tokio::sync::{Mutex, RwLock};
use tokio_rusqlite::Connection;

pub enum AgentWrapper {
    OpenAI(Agent<openai::CompletionModel>),
    Anthropic(Agent<anthropic::completion::CompletionModel>),
    Xai(Agent<xai::completion::CompletionModel>),
    DeepSeek(Agent<deepseek::DeepSeekCompletionModel>),
    Gemini(Agent<gemini::completion::CompletionModel>),
    Moonshot(Agent<moonshot::CompletionModel>),
}

// 应用状态，存储代理
#[allow(dead_code)]
pub struct AppState {
    pub agents: Mutex<HashMap<String, AgentWrapper>>,
    // db: RwLock<Database>,
    pub conn: RwLock<Connection>,
    pub mcp_manager: Arc<McpManager>,
    pub fastembed: Client,
}
